<?xml version="1.0"?>
<def format="2">
    <define name="LIBC" value="glibc"/>
    <define name="MAX_ERRMSG_LEN" value="256U"/>
    <define name="MAX_FNAME_LEN" value="1024"/>
    <define name="MAX_GID_VAL" value="4294967295"/>
    <define name="MAX_GRP_VAL" value="2147483647"/>
    <define name="MAX_LOGNAME_LEN" value="256U"/>
    <define name="MAX_NGROUPS" value="128U"/>
    <define name="MAX_NVARS" value="512"/>
    <define name="MAX_STR_LEN" value="8192U"/>
    <define name="MAX_SUFFIX_LEN" value="8U"/>
    <define name="MAX_UID_VAL" value="4294967295"/>
    <define name="MAX_URL_LEN" value="8192U"/>
    <define name="MAX_VARNAME_LEN" value="32U"/>
    <define name="MAX_VAR_LEN" value="1024"/>
    <define name="PATH" value='"/bin:/usr/bin"'/>
    <define name="START_UID" value="1000"/>
    <define name="STOP_UID" value="60000"/>
    <define name="START_GID" value="1000"/>
    <define name="STOP_GID" value="30000"/>

    <function name="env_is_name">
        <arg nr="1" direction="in">
            <not-null/>
            <not-uninit/>
            <strz/>
        </arg>
        <noreturn>false</noreturn>
        <use-retval/>
    </function>

    <function name="env_var_copy">
        <arg nr="1" direction="in">
            <not-null/>
            <not-uninit/>
            <strz/>
        </arg>
        <arg nr="2" direction="in">
            <not-bool/>
            <valid>1:</valid>
        </arg>
        <arg nr="3" direction="out">
            <not-null/>
        </arg>
        <arg nr="4" direction="out">
            <not-null/>
            <!-- Off by one, but all that Cppcheck can do. -->
            <minsize type="argvalue" arg="2"/>
        </arg>
        <not-overlapping-data ptr1-arg="1" ptr2-arg="4" size-arg="2"/>
        <noreturn>false</noreturn>
        <use-retval/>
    </function>

    <function name="env_restore">
        <arg nr="1" direction="in">
            <not-null/>
            <not-uninit/>
        </arg>
        <arg nr="2" direction="in">
            <not-bool/>
            <valid>1:</valid>
        </arg>
        <arg nr="3" direction="in">
            <not-null/>
            <not-uninit/>
            <minsize type="argvalue" arg="2"/>
        </arg>
        <noreturn>false</noreturn>
        <use-retval/>
    </function>

    <function name="error">
        <formatstr type="printf"/>
        <arg nr="1" direction="in">
            <formatstr/>
        </arg>
        <noreturn>true</noreturn>
    </function>

    <function name="handler_find">
        <arg nr="1" direction="in">
            <not-bool/>
            <valid>1:</valid>
        </arg>
        <arg nr="2" direction="in">
            <not-null/>
            <minsize type="argvalue" arg="1"/>
        </arg>
        <arg nr="3" direction="in">
            <not-bool/>
            <valid>1:</valid>
        </arg>
        <arg nr="4" direction="in">
            <not-null/>
            <not-uninit/>
            <strz/>
            <!-- Off by one, but all that Cppcheck can do. -->
            <minsize type="argvalue" arg="3"/>
        </arg>
        <arg nr="5" direction="out">
            <not-null/>
        </arg>
        <noreturn>false</noreturn>
        <use-retval/>
    </function>

    <function name="pair_find">
        <arg nr="1" direction="in">
            <not-bool/>
             <valid>1:</valid>
        </arg>
        <arg nr="2" direction="in">
            <not-null/>
            <minsize type="argvalue" arg="1"/>
        </arg>
        <arg nr="3" direction="in">
            <not-bool/>
            <valid>1:</valid>
        </arg>
        <arg nr="4" direction="in">
            <not-null/>
            <not-uninit/>
            <strz/>
            <!-- Off by one, but all that Cppcheck can do. -->
            <minsize type="argvalue" arg="3"/>
        </arg>
        <arg nr="5" direction="out">
            <not-null/>
        </arg>
        <noreturn>false</noreturn>
        <use-retval/>
    </function>

    <function name="path_within">
        <arg nr="1" direction="in">
            <not-bool/>
            <valid>1:</valid>
        </arg>
        <arg nr="2" direction="in">
            <not-null/>
            <not-uninit/>
            <strz/>
            <!-- Off by one, but all that Cppcheck can do. -->
            <minsize type="argvalue" arg="1"/>
        </arg>
        <arg nr="3" direction="in">
            <not-bool/>
            <valid>1:</valid>
        </arg>
        <arg nr="4" direction="in">
            <not-null/>
            <not-uninit/>
            <strz/>
            <!-- Off by one, but all that Cppcheck can do. -->
            <minsize type="argvalue" arg="3"/>
        </arg>
        <noreturn>false</noreturn>
        <use-retval/>
    </function>

    <function name="path_real">
        <arg nr="1" direction="in">
            <not-bool/>
            <valid>1:</valid>
        </arg>
        <arg nr="2" direction="in">
            <not-null/>
            <not-uninit/>
            <strz/>
            <!-- Off by one, but all that Cppcheck can do. -->
            <minsize type="argvalue" arg="1"/>
        </arg>
        <arg nr="3" direction="out">
            <not-null/>
        </arg>
        <arg nr="4" direction="out">
            <not-null/>
        </arg>
        <noreturn>false</noreturn>
        <use-retval/>
    </function>

    <function name="path_suffix">
        <arg nr="1" direction="in">
            <not-null/>
            <not-uninit/>
            <strz/>
        </arg>
        <arg nr="2" direction="out">
            <not-null/>
        </arg>
        <noreturn>false</noreturn>
        <use-retval/>
    </function>

    <function name="priv_drop">
        <arg nr="1" direction="in">
            <not-bool/>
            <valid>1:</valid>
        </arg>
        <arg nr="2" direction="in">
            <not-bool/>
            <valid>1:</valid>
        </arg>
        <arg nr="3" direction="in">
            <not-bool/>
            <valid>1:</valid>
        </arg>
        <arg nr="4" direction="in">
            <not-null/>
            <not-uninit/>
            <minsize type="argvalue" arg="3"/>
        </arg>
        <noreturn>false</noreturn>
        <use-retval/>
    </function>

    <function name="priv_suspend">
        <use-retval/>
        <noreturn>false</noreturn>
    </function>

    <function name="str_copy">
        <arg nr="1" direction="in">
            <not-bool/>
            <valid>0:</valid>
        </arg>
        <arg nr="2" direction="in">
            <not-null/>
            <not-uninit/>
            <strz/>
        </arg>
        <arg nr="3" direction="out">
            <not-null/>
            <!-- Off by one, but all that Cppcheck can do. -->
            <minsize type="argvalue" arg="1"/>
        </arg>
        <arg nr="4" direction="out"/>
        <noreturn>false</noreturn>
        <use-retval/>
    </function>

    <function name="str_split">
        <arg nr="1"  direction="in">
            <not-null/>
            <not-uninit/>
            <strz/>
        </arg>
        <arg nr="2"  direction="in">
            <not-null/>
            <not-uninit/>
            <strz/>
        </arg>
        <arg nr="3" direction="in">
            <not-bool/>
            <valid>1:</valid>
        </arg>
        <arg nr="4" direction="out">
            <not-null/>
            <minsize type="argvalue" arg="3"/>
        </arg>
        <arg nr="5" direction="out">
            <not-null/>
        </arg>
        <not-overlapping-data ptr1-arg="1" ptr2-arg="4" size-arg="3"/>
        <not-overlapping-data ptr1-arg="2" ptr2-arg="4" size-arg="3"/>
        <noreturn>false</noreturn>
        <use-retval/>
    </function>

    <function name="user_exp">
        <arg nr="1" direction="in">
            <not-null/>
            <not-uninit/>
            <strz/>
        </arg>
        <arg nr="2" direction="in">
            <not-null/>
        </arg>
        <arg nr="3" direction="in">
            <not-bool/>
            <valid>1:</valid>
        </arg>
        <arg nr="4" direction="out">
            <not-null/>
            <minsize type="argvalue" arg="3"/>
        </arg>
        <arg nr="5" direction="out">
            <not-null/>
        </arg>
        <not-overlapping-data ptr1-arg="1" ptr2-arg="4" size-arg="3"/>
        <noreturn>false</noreturn>
        <use-retval/>
    </function>

    <function name="config,help,usage,version">
        <noreturn>true</noreturn>
    </function>

    <!-- Test suite -->

    <function name="abort_catch">
        <arg nr="1" direction="in"/>
    </function>

    <function name="abort_reset">
        <arg nr="1" direction="in"/>
    </function>

    <function name="array_find">
        <arg nr="1" direction="in">
            <not-null/>
            <minsize type="mul" arg="3" arg2="4"/>
        </arg>
        <arg nr="2" direction="in">
            <not-null/>
        </arg>
        <arg nr="3" direction="in">
            <not-bool/>
            <valid>1:</valid>
        </arg>
        <arg nr="4" direction="in">
            <not-bool/>
        </arg>
        <arg nr="5" direction="in">
            <not-null/>
        </arg>
        <noreturn>false</noreturn>
        <use-retval/>
    </function>

    <function name="array_is_sub">
        <arg nr="1" direction="in">
            <not-null/>
            <minsize type="mul" arg="2" arg2="3"/>
        </arg>
        <arg nr="2" direction="in">
            <not-bool/>
        </arg>
        <arg nr="3" direction="in">
            <not-bool/>
            <valid>1:</valid>
        </arg>
        <arg nr="4" direction="in">
            <not-null/>
            <minsize type="mul" arg="5" arg2="6"/>
        </arg>
        <arg nr="5" direction="in">
            <not-bool/>
        </arg>
        <arg nr="6" direction="in">
            <not-bool/>
            <valid>1:</valid>
        </arg>
        <noreturn>false</noreturn>
        <use-retval/>
    </function>

    <function name="array_eq">
        <arg nr="1" direction="in">
            <not-null/>
            <minsize type="mul" arg="2" arg2="3"/>
        </arg>
        <arg nr="2" direction="in">
            <not-bool/>
        </arg>
        <arg nr="3" direction="in">
            <not-bool/>
            <valid>1:</valid>
        </arg>
        <arg nr="4" direction="in">
            <not-null/>
            <minsize type="mul" arg="5" arg2="6"/>
        </arg>
        <arg nr="5" direction="in">
            <not-bool/>
        </arg>
        <arg nr="6" direction="in">
            <not-bool/>
            <valid>1:</valid>
        </arg>
        <noreturn>false</noreturn>
        <use-retval/>
    </function>

    <function name="dir_tree_rm">
        <arg nr="1" direction="in">
            <not-null/>
            <not-uninit/>
            <strz/>
        </arg>
        <arg nr="2" direction="in"/>
    </function>

    <function name="dir_walk">
        <arg nr="1" direction="in">
            <not-null/>
            <not-uninit/>
            <strz/>
        </arg>
        <arg nr="2" direction="in"/>
        <arg nr="3" direction="in">
            <not-bool/>
        </arg>
        <arg nr="4" direction="in"/>
    </function>


    <function name="path_gen">
        <arg nr="1" direction="in">
            <not-bool/>
            <valid>1:</valid>
        </arg>
        <arg nr="2" direction="out">
            <not-null/>
            <!-- Off by one, but all that Cppcheck can do. -->
            <minsize type="argvalue" arg="1"/>
        </arg>
    </function>

    <function name="path_join">
        <arg nr="1" direction="in">
            <not-bool/>
            <valid>1:</valid>
        </arg>
        <arg nr="2" direction="out">
            <not-null/>
            <minsize type="argvalue" arg="1"/>
        </arg>
        <arg nr="3" direction="in">
            <not-null/>
            <not-uninit/>
            <strz/>
        </arg>
        <arg nr="4" direction="in">
            <not-null/>
            <not-uninit/>
            <strz/>
        </arg>
        <arg nr="5" direction="in"/>
    </function>

    <function name="path_split">
        <arg nr="1" direction="in">
            <not-null/>
            <not-uninit/>
            <strz/>
        </arg>
        <arg nr="2" direction="out"/>
        <arg nr="3" direction="in"/>
        <noreturn>false</noreturn>
        <use-retval/>
    </function>

    <function name="path_walk">
        <arg nr="1" direction="in">
            <not-null/>
            <not-uninit/>
            <strz/>
        </arg>
        <arg nr="2" direction="in"/>
        <arg nr="3" direction="in"/>
        <arg nr="4" direction="in"/>
        <arg nr="5" direction="in">
            <not-bool/>
        </arg>
    </function>

    <function name="sigs_trap">
        <arg nr="1" direction="in">
            <not-bool/>
        </arg>
        <arg nr="2" direction="in">
            <not-null/>
            <not-uninit/>
            <minsize type="argvalue" arg="1"/>
        </arg>
        <arg nr="3" direction="out">
            <minsize type="argvalue" arg="1"/>
        </arg>
        <arg nr="4" direction="in"/>
    </function>

    <function name="sigs_action">
        <arg nr="1" direction="in"/>
        <arg nr="2" direction="in">
            <not-bool/>
        </arg>
        <arg nr="3" direction="in">
            <not-null/>
            <not-uninit/>
            <minsize type="argvalue" arg="1"/>
        </arg>
        <arg nr="4" direction="out">
            <minsize type="argvalue" arg="1"/>
        </arg>
        <arg nr="5" direction="in"/>
    </function>

    <function name="sigs_handle">
        <arg nr="1" direction="in"/>
        <arg nr="2" direction="in">
            <not-bool/>
        </arg>
        <arg nr="3" direction="in">
            <not-null/>
            <not-uninit/>
            <minsize type="argvalue" arg="1"/>
        </arg>
        <arg nr="4" direction="out">
            <minsize type="argvalue" arg="1"/>
        </arg>
        <arg nr="5" direction="in"/>
    </function>

    <function name="sigs_raise_default">
        <arg nr="1" direction="in"/>
        <arg nr="2" direction="in"/>
    </function>

    <function name="sigs_retry_int">
        <arg nr="1" direction="in">
            <not-null/>
        </arg>
        <arg nr="2" direction="in">
            <not-bool/>
        </arg>
        <noreturn>false</noreturn>
        <use-retval/>
    </function>

    <function name="sigs_retry_ptr">
        <arg nr="1" direction="in">
            <not-null/>
        </arg>
        <arg nr="2" direction="in">
            <not-null/>
        </arg>
        <noreturn>false</noreturn>
        <use-retval/>
    </function>

    <function name="str_cmp_ptrs">
        <arg nr="1" direction="in">
            <not-null/>
            <not-uninit/>
        </arg>
        <arg nr="2" direction="in">
            <not-null/>
            <not-uninit/>
        </arg>
        <noreturn>false</noreturn>
        <use-retval/>
    </function>

    <function name="tmpdir_make">
        <arg nr="1" direction="in">
            <not-null/>
            <not-uninit/>
            <strz/>
        </arg>
        <arg nr="2" direction="out">
            <not-null/>
        </arg>
        <arg nr="3" direction="in"/>
    </function>

    <function name="user_get_gid">
        <arg nr="1" direction="in">
            <not-bool/>
        </arg>
        <arg nr="2" direction="out">
            <not-null/>
        </arg>
        <arg nr="3" direction="in"/>
    </function>

    <function name="user_get_regular">
        <arg nr="1" direction="out">
            <not-null/>
        </arg>
        <arg nr="2" direction="in"/>
    </function>

    <function name="user_id_to_str">
        <arg nr="1" direction="in">
            <not-bool/>
        </arg>
        <arg nr="2" direction="in"/>
        <use-retval/>
    </function>

    <function name="walk_dir_contents,walk_dir_entry">
        <arg nr="1" direction="in">
            <not-null/>
            <not-uninit/>
            <strz/>
        </arg>
        <arg nr="2" direction="in"/>
        <arg nr="3" direction="in">
            <not-bool/>
        </arg>
        <arg nr="4" direction="in"/>
        <noreturn>false</noreturn>
        <use-retval/>
    </function>
</def>
